package com.xunk.scene.enums;

import com.xunk.common.core.utils.StringUtils;
import lombok.Getter;

/**
 * @ProjectName: HIM
 * @Package: com.xunk.scene.enums
 * @ClassName: ExecutionResultEnum
 * @Author: luanzhiwei
 * @Description: 执行结果枚举
 * @Date: 2021/5/14 11:22
 * @Version: 1.0
 */
@Getter
public enum ExecutionResultEnum {

    EXECUTING("EXECUTING", "执行中"),
    SUCCESS("SUCCESS", "执行成功"),
    FAIL("FAIL", "执行失败");

    ExecutionResultEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private String code;
    private String desc;

    /**
     * 根据code查询描述
     *
     * @param inCode
     * @return
     */
    public static String getDescByCode(String inCode) {
        String outDesc = StringUtils.EMPTY;
        for (ExecutionResultEnum value : ExecutionResultEnum.values()) {
            if (value.getCode().equals(inCode)) {
                outDesc = value.getDesc();
            }
        }
        return outDesc;
    }

}
